package com.colorlight.cloud.gateway.core.model;

import com.colorlight.cloud.common.model.enums.api.ExceptionInterface;
import lombok.Getter;

/**
 * @author Demon
 * GatewayCore服务异常定义
 * 服务前缀 400XX
 */
@Getter
public enum GatewayCoreExceptionEnum implements ExceptionInterface<GatewayCoreExceptionEnum> {
	
	
	TOPIC_INVALID_PARAMETER_EXCEPTION(40001, "无效主题"),
	MESSAGE_INVALID_PARAMETER_EXCEPTION(40002, "无效消息"),
	MESSAGE_DECOMPOSITION_EXCEPTION(40003, "消息分解异常"),
	SCHEDULE_ACTIONS_INVALID_PARAMETER_EXCEPTION(40003, "指令异常"),
	INSTRUCTION_DELIVERY_EXCEPTION(40004, "指令下发异常"),
	PROCESS_MESSAGE_EVENT_HANDLER_NOT_FOUND(40005, "未找到消息处理"),
	PROCESS_MESSAGE_EVENT_HANDLER_IS_NULL(40006, "未找到消息处理");
	/**
	 * 编码
	 */
	private final Integer code;
	
	/**
	 * 异常信息描述
	 */
	private final String description;
	
	
	GatewayCoreExceptionEnum(Integer code, String description) {
		this.code = code;
		this.description = description;
	}
	
	@Override
	public Integer getCode() {
		return code;
	}
	
	@Override
	public GatewayCoreExceptionEnum getT() {
		return this;
	}
	
	@Override
	public String getThisDescription() {
		return this.getDescription();
	}
}
